package cfca.seal.util;

import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.Properties;

public class ExceptionUtil
{
  private static Properties exceptionProperties = new Properties();

  public ExceptionUtil(String errorInfoFile) throws Exception {
    exceptionProperties.load(new InputStreamReader(new FileInputStream(errorInfoFile), "UTF-8"));
  }

  public String getMessageByCode(String code) {
    String errorInfo = "";
    if (exceptionProperties.containsKey(code)) {
      errorInfo = exceptionProperties.getProperty(code);
    }
    return errorInfo;
  }
}